@extends('layouts.public')

@section('bodyattr')class="gray-bg"@endsection

@section('body')
    <div class="wrapper wrapper-content">
        <div class="row m-b">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active" href="{{route('admin.shop.shops.comment', $id)}}"><a href="#">评论列表</a></li>
                        <li><a href="{{route('admin.shop.shops.comment_add',$id)}}">新增</a></li>

                    </ul>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <form role="form" class="form-inline" method="get">
                            <div class="form-group">
                                <label class="sr-only">评论搜索</label>
                                <input type="text" name="title" placeholder="请输入评论内容" class="form-control" value="{{request('title')}}">
                            </div>
                            &nbsp;&nbsp;
                            <div class="form-group">
                                <input placeholder="请选择评论时间范围" class="form-control" id="created_at" type="text" name="created_at" value="{{request('created_at')}}" style="width: 200px;"
                                       autocomplete="off">
                            </div>
                            <button type="submit" class="btn btn-primary">搜索</button>
                            <button type="button" class="btn btn-white" onclick="location.href='{{route('admin.shop.shops.comment', $id)}}'">重置</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
                            <thead>
                            <tr role="row">
                                <th>ID</th>
{{--                                <th>头像</th>--}}
                                <th>内容</th>
                                <th>作者</th>
                                <th class="sorting" orderby="created_at">创建时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            @foreach($forums as $forums)
                                <tr class="gradeA">
                                    <td>{{$forums['id']}}</td>
{{--                                    <td><img src="{{$forums['avatar']}}" alt=""></td>--}}
                                    <td>{{$forums['comment']}}</td>
                                    <td>{{$forums['uname']}}</td>
                                    <td>{{$forums['created_at']}}</td>
                                    <td>
{{--                                        <a href="{{route('admin.forum.forums.comment_edit.',[$forums->id])}}">编辑</a>|--}}

                                       @if ($forums['status']!=1)
                                        <a href="{{route('admin.shop.shops.comment_shen',[$forums->id])}}">审核</a>|
                                        @endif
                                         <a class="ajaxBtn" href="javascript:void(0);" uri="{{route('admin.shop.shops.comment_delete',[$forums->id])}}" msg="是否删除该评论？">删除</a>
                                    </td>
                                </tr>
                            @endforeach
                        </table>
{{--                        <div class="row">--}}
{{--                            <div class="col-sm-12">--}}
{{--                                <div>共 {{ $forums->total() }} 条记录</div>--}}
{{--                                {!! $forums->links() !!}--}}
{{--                            </div>--}}
{{--                        </div>--}}
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@section('script')
    <script type="text/javascript" src="{{cdn('js/plugins/laydate/laydate.js')}}"></script>
    <script type="text/javascript">
        laydate.render({
            elem: '#created_at',
            range: true,
            max: 0
        });
    </script>
@endsection
